import java.util.HashMap;

/**
 * @Author: zhaobl
 * @Time: 2018/12/1 11:51
 * @Description:
 */
public class Users {
    public static void main(String[] args) {
        //demo();
        //demo1();
        demo2();
    }

    private static void demo(){
        String name = "小红";
        int age = 19;
        User user = (String username,int userage) -> {
            return username+"今年"+userage+"岁了";
        };
        System.out.println(user.userInfo(name,age));

        User user2 = (username,userage) -> username+"今年"+userage+"岁了";
        System.out.println(user2.userInfo(name,age));
    }

    private static void demo1(){

        String name = "小芳";
        int age1 = 17;
        double age2 = 17.5;

        MyUser<Integer> myUser = (n,a) -> n+a;
        String str1 = myUser.userInfo(name,age1);
        System.out.println(str1);

        MyUser<Double> myUser1 = (n,a) -> n+a;
        String str2 = myUser1.userInfo(name,age2);
        System.out.println(str2);
    }

    private static void demo2(){
        String name = "小红";
        int age = 22;
        int status = 1;
        User user = (n,a) -> {
            //status ++; //不允许
            return n+a+"状态是"+status;
        };
        //status ++; //不允许
        String str = user.userInfo(name,age);
        System.out.println(str);


        System.out.println(age);
    }

}
